import request from '@/utils/request'

// 查询学生信息列表
export function listStudent(query) {
  return request({
    url: '/system/student/list',
    method: 'get',
    params: query
  })
}

// 查询学生信息详细
export function getStudent(id) {
  return request({
    url: '/system/student/' + id,
    method: 'get'
  })
}

// 新增学生信息
export function addStudent(data) {
  return request({
    url: '/system/student',
    method: 'post',
    data: data
  })
}

// 修改学生信息
export function updateStudent(data) {
  return request({
    url: '/system/student',
    method: 'put',
    data: data
  })
}

// 删除学生信息
export function delStudent(ids) {
  return request({
    url: '/system/student/' + ids,
    method: 'delete'
  })
}

// 导出学生信息
export function exportStudent(query) {
  return request({
    url: '/system/student/export',
    method: 'post',
    params: query
  })
}

// 获取学生信息导入模板
export function importTemplate() {
  return request({
    url: '/system/student/importTemplate',
    method: 'post'
  })
}

// 学生数据导入
export function importData(data) {
  return request({
    url: '/system/student/importData',
    method: 'post',
    data: data
  })
}

// 上传图片
export function uploadImage(data) {
  return request({
    url: '/system/student/uploadImage',
    method: 'post',
    data: data
  })
}

// 上传视频
export function uploadVideo(data) {
  return request({
    url: '/system/student/uploadVideo',
    method: 'post',
    data: data
  })
}

// 获取学生项目描述
export function getStudentDescription(studentId) {
  return request({
    url: '/system/student/description/' + studentId,
    method: 'get'
  })
}

// 保存学生项目描述
export function saveStudentDescription(data) {
  return request({
    url: '/system/student/description',
    method: 'post',
    data: data
  })
}

// 获取学生图片列表
export function getStudentImages(studentId) {
  return request({
    url: '/system/student/images/' + studentId,
    method: 'get'
  })
}

// 添加学生图片
export function addStudentImage(data) {
  return request({
    url: '/system/student/images',
    method: 'post',
    data: data
  })
}

// 删除学生图片
export function deleteStudentImage(id) {
  return request({
    url: '/system/student/images/' + id,
    method: 'delete'
  })
}

// 批量删除学生图片
export function deleteStudentImages(ids) {
  return request({
    url: '/system/student/images/batch',
    method: 'delete',
    data: ids
  })
}
